//
//  MainViewController.swift
//  willdo
//
//  Created by zz on 3/13/18.
//  Copyright © 2018 will do. All rights reserved.
//

import UIKit

class MainViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        addChildViewControllers()
        
    }

    func addChildViewControllers() {
        addChildVC(vc: TaskViewController(), title: "任务", imgName: "assignment_btn")
        addChildVC(vc: ContactViewController(), title: "联系人", imgName: "contacts_btn")
        addChildVC(vc: MeViewController(), title: "我的", imgName: "me_btn")
    }

    func addChildVC(vc: UIViewController, title:String, imgName:String){
        //tabBar.tintColor = UIColor(red: 39/255.0, green: 176/255.0, blue: 174/255.0, alpha: 1.0)
        //tabBar.isTranslucent = false
        vc.title = title
        vc.tabBarItem.image = UIImage(named: imgName)
        vc.tabBarItem.selectedImage = UIImage(named: imgName+"_highlight")
        
        let nav = UINavigationController(rootViewController: vc)
        //nav.navigationBar.isTranslucent = false
//        let img = UIImage(named: "")
        addChildViewController(nav)
        
    }
    
}
